module.exports = function (gulp, $, config) {
  gulp.task('coffee', function(done) {
    var uglify = $.if(config.isProduction, $.uglify()
      .on('error', function (e) {
        console.log(e);
      }));
    return gulp.src(config.coffee.path)
      .pipe($.coffee({bare: true}).on('error', $.util.log))
      .pipe($.ngAnnotate({single_quotes: true}))
      .pipe($.concat(config.coffee.source))
      .pipe(uglify)
      .pipe(gulp.dest(config.coffee.dest))
      .pipe($.browser.stream());
  });
}
